<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 19-2-28
 * Time: 下午3:13
 */

namespace common\models;


/**
 * Class EdiviCommonBackLogs
 * @package common\models
 *
 * @property EdiviCreditOrder $ediviCreditOrder
 */
class EdiviCommonBackLogs extends \common\models\base\EdiviCommonBackLogs
{
    const TRANS_TYPE_0 = 0;
    const TRANS_TYPE_1 = 1;
    const TRANS_TYPE_2 = 2;
    const TRANS_TYPE_3 = 3;
    const TRANS_TYPE_4 = 4;
    const TRANS_TYPE_5 = 5;
    const TRANS_TYPE_6 = 6;
    const TRANS_TYPE_7 = 7;
    const TRANS_TYPE_8 = 8;
    const TRANS_TYPE_9 = 9;
    const TRANS_TYPE_10 = 10;
    const TRANS_TYPE_11 = 11;
    const TRANS_TYPE_12 = 12;
    const TRANS_TYPE_17 = 17;
    const TRANS_TYPE_18 = 18;
    const TRANS_TYPE_19 = 19;
    public static function getTransTypes()
    {
        return [
            self::TRANS_TYPE_0 => "放款成功", // （仅限测试环境，因无真实放款数据，故标记为0，生产环境无该类型通知）
            self::TRANS_TYPE_1 => "征信退回",
            self::TRANS_TYPE_2 => "分期退回",
            self::TRANS_TYPE_3 => "拒绝受理",
            self::TRANS_TYPE_4 => "授信通过",
            self::TRANS_TYPE_5 => "等待押品补录",
            self::TRANS_TYPE_6 => "材料补录",
            self::TRANS_TYPE_7 => "放款通知",
            self::TRANS_TYPE_8 => "分行审查通过",
            self::TRANS_TYPE_9 => "取消订单",
            self::TRANS_TYPE_10 => "行方签署完合同通知",
            self::TRANS_TYPE_11 => "上送分期信息超期提醒",
            self::TRANS_TYPE_12 => "押品补录超期提醒",
            self::TRANS_TYPE_17 => "放款失败通知",
            self::TRANS_TYPE_18 => "关联人补查结果通知",
            self::TRANS_TYPE_19 => "客户合同签署完成通知",
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getEdiviCreditOrder()
    {
        return $this->hasOne(EdiviCreditOrder::className(), ['id' => 'edivi_credit_order_id']);
    }
}